home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / message / msgbox2 / _msgbox.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-01-18  |  42.6 KB  |  1,008 lines

  1. VERSION 2.00
  2. Begin Form MsgBxGen 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "MsgBox Editor 2.1"
  6.    ClientHeight    =   4428
  7.    ClientLeft      =   1260
  8.    ClientTop       =   1692
  9.    ClientWidth     =   8148
  10.    Height          =   4800
  11.    Icon            =   _MSGBOX.FRX:0000
  12.    Left            =   1212
  13.    LinkMode        =   1  'Source
  14.    LinkTopic       =   "Form1"
  15.    MaxButton       =   0   'False
  16.    ScaleHeight     =   4428
  17.    ScaleWidth      =   8148
  18.    Top             =   1368
  19.    Width           =   8244
  20.    Begin SSFrame Frame3D1 
  21.       Caption         =   "&Icon Display Options"
  22.       Font3D          =   0  'None
  23.       ForeColor       =   &H00000000&
  24.       Height          =   4212
  25.       Left            =   60
  26.       TabIndex        =   0
  27.       Top             =   60
  28.       Width           =   2832
  29.       Begin PictureBox IconPic 
  30.          BackColor       =   &H00C0C0C0&
  31.          BorderStyle     =   0  'None
  32.          Height          =   1095
  33.          Index           =   32
  34.          Left            =   1500
  35.          Picture         =   _MSGBOX.FRX:0302
  36.          ScaleHeight     =   1092
  37.          ScaleWidth      =   1212
  38.          TabIndex        =   2
  39.          Top             =   240
  40.          Width           =   1215
  41.          Begin Label IcPicLabel 
  42.             BackColor       =   &H00C0C0C0&
  43.             Caption         =   "Questions for the User"
  44.             FontBold        =   0   'False
  45.             FontItalic      =   0   'False
  46.             FontName        =   "MS Sans Serif"
  47.             FontSize        =   7.8
  48.             FontStrikethru  =   0   'False
  49.             FontUnderline   =   0   'False
  50.             Height          =   495
  51.             Index           =   32
  52.             Left            =   120
  53.             TabIndex        =   3
  54.             Top             =   600
  55.             Width           =   975
  56.          End
  57.       End
  58.       Begin PictureBox IconPic 
  59.          BackColor       =   &H00C0C0C0&
  60.          BorderStyle     =   0  'None
  61.          Height          =   1095
  62.          Index           =   16
  63.          Left            =   180
  64.          Picture         =   _MSGBOX.FRX:0604
  65.          ScaleHeight     =   1092
  66.          ScaleWidth      =   1212
  67.          TabIndex        =   6
  68.          Top             =   1500
  69.          Width           =   1215
  70.          Begin Label IcPicLabel 
  71.             BackColor       =   &H00C0C0C0&
  72.             Caption         =   "Critical Error Messages"
  73.             FontBold        =   0   'False
  74.             FontItalic      =   0   'False
  75.             FontName        =   "MS Sans Serif"
  76.             FontSize        =   7.8
  77.             FontStrikethru  =   0   'False
  78.             FontUnderline   =   0   'False
  79.             Height          =   495
  80.             Index           =   16
  81.             Left            =   120
  82.             TabIndex        =   7
  83.             Top             =   600
  84.             Width           =   975
  85.          End
  86.       End
  87.       Begin PictureBox IconPic 
  88.          BackColor       =   &H00C0C0C0&
  89.          BorderStyle     =   0  'None
  90.          Height          =   1095
  91.          Index           =   64
  92.          Left            =   1500
  93.          Picture         =   _MSGBOX.FRX:0906
  94.          ScaleHeight     =   1092
  95.          ScaleWidth      =   1212
  96.          TabIndex        =   4
  97.          Top             =   1500
  98.          Width           =   1215
  99.          Begin Label IcPicLabel 
  100.             BackColor       =   &H00C0C0C0&
  101.             Caption         =   "Information for the User"
  102.             FontBold        =   0   'False
  103.             FontItalic      =   0   'False
  104.             FontName        =   "MS Sans Serif"
  105.             FontSize        =   7.8
  106.             FontStrikethru  =   0   'False
  107.             FontUnderline   =   0   'False
  108.             Height          =   495
  109.             Index           =   64
  110.             Left            =   120
  111.             TabIndex        =   5
  112.             Top             =   600
  113.             Width           =   975
  114.          End
  115.       End
  116.       Begin PictureBox IconPic 
  117.          BackColor       =   &H00C0C0C0&
  118.          BorderStyle     =   0  'None
  119.          Height          =   1095
  120.          Index           =   48
  121.          Left            =   180
  122.          Picture         =   _MSGBOX.FRX:0C08
  123.          ScaleHeight     =   1092
  124.          ScaleWidth      =   1212
  125.          TabIndex        =   8
  126.          Top             =   2880
  127.          Width           =   1215
  128.          Begin Label IcPicLabel 
  129.             BackColor       =   &H00C0C0C0&
  130.             Caption         =   "Important Messages"
  131.             FontBold        =   0   'False
  132.             FontItalic      =   0   'False
  133.             FontName        =   "MS Sans Serif"
  134.             FontSize        =   7.8
  135.             FontStrikethru  =   0   'False
  136.             FontUnderline   =   0   'False
  137.             Height          =   495
  138.             Index           =   48
  139.             Left            =   120
  140.             TabIndex        =   9
  141.             Top             =   600
  142.             Width           =   975
  143.          End
  144.       End
  145.       Begin PictureBox IconPic 
  146.          BackColor       =   &H00C0C0C0&
  147.          BorderStyle     =   0  'None
  148.          Height          =   1095
  149.          Index           =   0
  150.          Left            =   1500
  151.          ScaleHeight     =   1092
  152.          ScaleWidth      =   1212
  153.          TabIndex        =   10
  154.          Top             =   2880
  155.          Width           =   1215
  156.          Begin Label IcPicLabel 
  157.             BackColor       =   &H00C0C0C0&
  158.             Caption         =   "No Icon Displayed"
  159.             FontBold        =   0   'False
  160.             FontItalic      =   0   'False
  161.             FontName        =   "MS Sans Serif"
  162.             FontSize        =   7.8
  163.             FontStrikethru  =   0   'False
  164.             FontUnderline   =   0   'False
  165.             Height          =   495
  166.             Index           =   0
  167.             Left            =   240
  168.             TabIndex        =   11
  169.             Top             =   600
  170.             Width           =   975
  171.          End
  172.       End
  173.       Begin Label Label1 
  174.          BackColor       =   &H00C0C0C0&
  175.          Caption         =   "Click on the icon of your choice to place it on your MsgBox"
  176.          Height          =   1092
  177.          Left            =   180
  178.          TabIndex        =   1
  179.          Top             =   240
  180.          Width           =   1212
  181.       End
  182.    End
  183.    Begin SSFrame Frame3D2 
  184.       Caption         =   "&Button Display Options"
  185.       Font3D          =   0  'None
  186.       ForeColor       =   &H00000000&
  187.       Height          =   1992
  188.       Left            =   3000
  189.       TabIndex        =   12
  190.       Top             =   60
  191.       Width           =   3372
  192.       Begin SSOption ButOpt3D 
  193.          Caption         =   "Ok Button Only"
  194.          Font3D          =   0  'None
  195.          Height          =   255
  196.          Index           =   0
  197.          Left            =   120
  198.          TabIndex        =   13
  199.          Top             =   360
  200.          Width           =   3135
  201.       End
  202.       Begin SSOption ButOpt3D 
  203.          Caption         =   "Ok and Cancel Buttons"
  204.          Font3D          =   0  'None
  205.          Height          =   255
  206.          Index           =   1
  207.          Left            =   120
  208.          TabIndex        =   14
  209.          TabStop         =   0   'False
  210.          Top             =   600
  211.          Width           =   3135
  212.       End
  213.       Begin SSOption ButOpt3D 
  214.          Caption         =   "Abort, Retry, and Ignore Buttons"
  215.          Font3D          =   0  'None
  216.          Height          =   255
  217.          Index           =   2
  218.          Left            =   120
  219.          TabIndex        =   15
  220.          TabStop         =   0   'False
  221.          Top             =   840
  222.          Width           =   3135
  223.       End
  224.       Begin SSOption ButOpt3D 
  225.          Caption         =   "Yes, No, and Cancel Buttons"
  226.          Font3D          =   0  'None
  227.          Height          =   255
  228.          Index           =   3
  229.          Left            =   120
  230.          TabIndex        =   16
  231.          TabStop         =   0   'False
  232.          Top             =   1080
  233.          Width           =   3135
  234.       End
  235.       Begin SSOption ButOpt3D 
  236.          Caption         =   "Yes and No Buttons"
  237.          Font3D          =   0  'None
  238.          Height          =   255
  239.          Index           =   4
  240.          Left            =   120
  241.          TabIndex        =   17
  242.          TabStop         =   0   'False
  243.          Top             =   1320
  244.          Width           =   3135
  245.       End
  246.       Begin SSOption ButOpt3D 
  247.          Caption         =   "Retry and Cancel Buttons"
  248.          Font3D          =   0  'None
  249.          Height          =   255
  250.          Index           =   5
  251.          Left            =   120
  252.          TabIndex        =   18
  253.          TabStop         =   0   'False
  254.          Top             =   1560
  255.          Width           =   3135
  256.       End
  257.    End
  258.    Begin SSFrame Frame3D3 
  259.       Caption         =   "Call &Type"
  260.       Font3D          =   0  'None
  261.       ForeColor       =   &H00000000&
  262.       Height          =   1152
  263.       Left            =   6480
  264.       TabIndex        =   19
  265.       Top             =   60
  266.       Width           =   1572
  267.       Begin SSOption CodeOpt3D 
  268.          Caption         =   "Statement"
  269.          Font3D          =   0  'None
  270.          Height          =   252
  271.          Index           =   0
  272.          Left            =   120
  273.          TabIndex        =   20
  274.          Top             =   360
  275.          Value           =   -1  'True
  276.          Width           =   1332
  277.       End
  278.       Begin SSOption CodeOpt3D 
  279.          Caption         =   "Function"
  280.          Font3D          =   0  'None
  281.          Height          =   252
  282.          Index           =   1
  283.          Left            =   120
  284.          TabIndex        =   21
  285.          TabStop         =   0   'False
  286.          Top             =   660
  287.          Width           =   1332
  288.       End
  289.    End
  290.    Begin SSFrame Frame3D4 
  291.       Caption         =   "&Default Button Option"
  292.       Font3D          =   0  'None
  293.       ForeColor       =   &H00000000&
  294.       Height          =   1152
  295.       Left            =   3360
  296.       TabIndex        =   22
  297.       Top             =   2160
  298.       Width           =   2172
  299.       Begin SSOption optDefButton 
  300.          Caption         =   "&1st Button"
  301.          Font3D          =   0  'None
  302.          Height          =   252
  303.          Index           =   0
  304.          Left            =   360
  305.          TabIndex        =   23
  306.          Top             =   300
  307.          Value           =   -1  'True
  308.          Width           =   1212
  309.       End
  310.       Begin SSOption optDefButton 
  311.          Caption         =   "&2nd Button"
  312.          Font3D          =   0  'None
  313.          Height          =   252
  314.          Index           =   256
  315.          Left            =   360
  316.          TabIndex        =   24
  317.          TabStop         =   0   'False
  318.          Top             =   540
  319.          Width           =   1212
  320.       End
  321.       Begin SSOption optDefButton 
  322.          Caption         =   "&3rd Button"
  323.          Font3D          =   0  'None
  324.          Height          =   252
  325.          Index           =   512
  326.          Left            =   360
  327.          TabIndex        =   25
  328.          TabStop         =   0   'False
  329.          Top             =   780
  330.          Width           =   1212
  331.       End
  332.    End
  333.    Begin SSCommand AboutCommand3D 
  334.       Caption         =   "&About..."
  335.       Font3D          =   0  'None
  336.       FontBold        =   0   'False
  337.       FontItalic      =   0   'False
  338.       FontName        =   "MS Sans Serif"
  339.       FontSize        =   9.6
  340.       FontStrikethru  =   0   'False
  341.       FontUnderline   =   0   'False
  342.       Height          =   312
  343.       Left            =   6480
  344.       TabIndex        =   33
  345.       Top             =   1260
  346.       Width           =   1572
  347.    End
  348.    Begin SSCommand cmdCodeOpts 
  349.       Caption         =   "&Code Options..."
  350.       Font3D          =   0  'None
  351.       FontBold        =   0   'False
  352.       FontItalic      =   0   'False
  353.       FontName        =   "MS Sans Serif"
  354.       FontSize        =   9.6
  355.       FontStrikethru  =   0   'False
  356.       FontUnderline   =   0   'False
  357.       Height          =   312
  358.       Left            =   6480
  359.       TabIndex        =   34
  360.       Top             =   1620
  361.       Width           =   1572
  362.    End
  363.    Begin CommandButton ExitCtl 
  364.       Cancel          =   -1  'True
  365.       Caption         =   "E&xit"
  366.       FontBold        =   -1  'True
  367.       FontItalic      =   0   'False
  368.       FontName        =   "MS Sans Serif"
  369.       FontSize        =   9.6
  370.       FontStrikethru  =   0   'False
  371.       FontUnderline   =   0   'False
  372.       Height          =   312
  373.       Left            =   6480
  374.       TabIndex        =   35
  375.       Top             =   1980
  376.       Width           =   1572
  377.    End
  378.    Begin SSFrame Frame3D5 
  379.       Caption         =   "Modal"
  380.       Font3D          =   0  'None
  381.       ForeColor       =   &H00000000&
  382.       Height          =   912
  383.       Left            =   5880
  384.       TabIndex        =   26
  385.       Top             =   2400
  386.       Width           =   1632
  387.       Begin SSOption optModal 
  388.          Caption         =   "Application"
  389.          Font3D          =   0  'None
  390.          Height          =   252
  391.          Index           =   0
  392.          Left            =   120
  393.          TabIndex        =   27
  394.          Top             =   300
  395.          Value           =   -1  'True
  396.          Width           =   1392
  397.       End
  398.       Begin SSOption optModal 
  399.          Caption         =   "System"
  400.          Font3D          =   0  'None
  401.          Height          =   252
  402.          Index           =   4096
  403.          Left            =   120
  404.          TabIndex        =   28
  405.          TabStop         =   0   'False
  406.          Top             =   540
  407.          Width           =   1392
  408.       End
  409.    End
  410.    Begin CommandButton EditCtl 
  411.       Caption         =   "&Edit Message Box Title and Contents"
  412.       FontBold        =   -1  'True
  413.       FontItalic      =   0   'False
  414.       FontName        =   "MS Sans Serif"
  415.       FontSize        =   9.6
  416.       FontStrikethru  =   0   'False
  417.       FontUnderline   =   0   'False
  418.       Height          =   492
  419.       Left            =   3000
  420.       TabIndex        =   29
  421.       Top             =   3420
  422.       Width           =   5052
  423.    End
  424.    Begin CommandButton cmdPrevCode 
  425.       Caption         =   "&Preview Code"
  426.       FontBold        =   -1  'True
  427.       FontItalic      =   0   'False
  428.       FontName        =   "MS Sans Serif"
  429.       FontSize        =   9.6
  430.       FontStrikethru  =   0   'False
  431.       FontUnderline   =   0   'False
  432.       Height          =   372
  433.       Left            =   3000
  434.       TabIndex        =   30
  435.       Top             =   3960
  436.       Width           =   1692
  437.    End
  438.    Begin CommandButton cmdPreview 
  439.       Caption         =   "&Preview MsgBox"
  440.       FontBold        =   -1  'True
  441.       FontItalic      =   0   'False
  442.       FontName        =   "MS Sans Serif"
  443.       FontSize        =   9.6
  444.       FontStrikethru  =   0   'False
  445.       FontUnderline   =   0   'False
  446.       Height          =   372
  447.       Left            =   4740
  448.       TabIndex        =   31
  449.       Top             =   3960
  450.       Width           =   1932
  451.    End
  452.    Begin CommandButton CopyCtl 
  453.       Caption         =   "&Clipboard"
  454.       Default         =   -1  'True
  455.       FontBold        =   -1  'True
  456.       FontItalic      =   0   'False
  457.       FontName        =   "MS Sans Serif"
  458.       FontSize        =   9.6
  459.       FontStrikethru  =   0   'False
  460.       FontUnderline   =   0   'False
  461.       Height          =   372
  462.       Left            =   6720
  463.       TabIndex        =   32
  464.       Top             =   3960
  465.       Width           =   1332
  466.    End
  467. Option Explicit
  468. Sub AboutCommand3D_Click ()
  469.   MBAbout.Show 1
  470. End Sub
  471. Sub ButOpt3D_Click (Index As Integer, Value As Integer)
  472.     ' Set Global to the type of buttons to show
  473.     gintButtonstyle = Index
  474.     ' Set Default button to appropate setting
  475.     Select Case Index
  476.       Case 0       ' Only one button in the MsgBox
  477.     optDefButton(0).Value = True
  478.     optDefButton(256).Enabled = False
  479.     optDefButton(512).Enabled = False
  480.       Case 1, 4, 5 ' Two buttons in the MsgBox
  481.     optDefButton(256).Enabled = True
  482.     If gintDefault = 512 Then
  483.       optDefButton(0).Value = True
  484.     End If
  485.     optDefButton(512).Enabled = False
  486.       Case 2, 3    ' Three buttons in the MsgBox
  487.     optDefButton(256).Enabled = True
  488.     optDefButton(512).Enabled = True
  489.     End Select
  490. End Sub
  491. Sub cmdCodeOpts_Click ()
  492.   ' Show the Code Options form
  493.   frmCodeOpts.Show 1
  494.   ' Unload the Code Options form all done with it
  495.   Unload frmCodeOpts
  496. End Sub
  497. Sub cmdPrevCode_Click ()
  498.   Load frmPrevCode
  499.   frmPrevCode!txtCodeView.Text = GetMsgBoxCode()
  500.   frmPrevCode.Show 1
  501.   Unload frmPrevCode
  502. End Sub
  503. Sub cmdPreview_Click ()
  504.   'Dim pstrCode As String
  505.   ' This is neet code to have some times
  506.   'pstrCode = GetMsgBoxCode()
  507.   'MsgBox pstrCode, 0, "MsgBox Editor"
  508.   Dim pstrMsgBoxIni As String
  509.   Dim pstr3DUse As String
  510.   pstrMsgBoxIni = MakePath((app.Path), app.EXEName & ".ini")
  511.   pstr3DUse = ReadIni("Code Options", "Use 3D", "Never", pstrMsgBoxIni)
  512.   If pstr3DUse <> "None" Then
  513.     Call Turn3dOnOff
  514.   End If
  515.   If gstrTheTitle <> "" Then
  516.       MsgBox gstrRawMessage, gintDefault + gintIconstyle + gintButtonstyle + gintModal, gstrTheTitle
  517.   Else
  518.       ' No title selected so we add a good default titel
  519.       MsgBox gstrRawMessage, gintDefault + gintIconstyle + gintButtonstyle + gintModal, "Project1"
  520.   End If
  521.   If pstr3DUse <> "None" Then
  522.     Call Turn3dOnOff
  523.   End If
  524. End Sub
  525. Sub CopyCtl_Click ()
  526.   Dim pintTheAnswer As Integer
  527.   ' Put all code on the clipboard
  528.   Clipboard.SetText GetMsgBoxCode(), 1
  529.   ' Ask if the program should shut down or just mimimiz it's self
  530.   Call Turn3dOnOff
  531.   pintTheAnswer = MsgBox("Iconize this program (No means exit!) ?", 36, "MsgBox Editor")
  532.   Call Turn3dOnOff
  533.   If pintTheAnswer = 6 Then  'Answered Yes
  534.     WindowState = MINIMIZED
  535.   Else     'Answered No
  536.     Unload Me
  537.   End If
  538. End Sub
  539. Sub EditCtl_Click ()
  540.     ' Show MsgEdit form to allow for editing of
  541.     ' the titel and the message
  542.     MsgEdit.Show 1
  543.     ' Unload the MsgEdit form all done for now
  544.     Unload MsgEdit
  545.     ' Set the focus to the Clipboard button
  546.     ' Maby this sgould to to the Preview button?
  547.     Me.CopyCtl.SetFocus
  548. End Sub
  549. Sub ExitCtl_Click ()
  550.     ' Unload the form to close the app
  551.     Unload Me
  552. End Sub
  553. Sub Form_Load ()
  554.     Dim pstrMsgBoxIni As String
  555.     Dim pintTop As Integer
  556.     Dim pintLeft As Integer
  557.     Dim pintNoIni As Integer
  558.     screen.MousePointer = 11
  559.     ' Initialize variables and controls
  560.     gintDefault = 0
  561.     gintIconstyle = 0
  562.     gintButtonstyle = 0
  563.     ButOpt3D(gintButtonstyle).Value = True
  564.     MsgBxGen.WindowState = 0
  565.     gstrCR = Chr$(13) & Chr$(10)
  566.     gstrQ = Chr$(34)
  567.     gstrTheMessage = gstrQ
  568.     ' Get the app's ini file and location
  569.     pstrMsgBoxIni = MakePath((app.Path), app.EXEName & ".ini")
  570.     pintTop = Val(ReadIni("MsgBox", "Top", "-10000", pstrMsgBoxIni))
  571.     If pintTop = -10000 Then  ' See if no top entry in the ini file the
  572.                   ' assumption is there is no ini file if true
  573.       pintNoIni = True        ' Set procedure flag to true
  574.       pintTop = (screen.Height - Me.Height) / 2  ' Set the top of the form
  575.     End If
  576.     pintLeft = Val(ReadIni("MsgBox", "Left", Str((screen.Width - Me.Width) / 2), pstrMsgBoxIni))
  577.     Me.Move pintLeft, pintTop
  578.     screen.MousePointer = 0
  579.     ' If this is the first run (or there is no ini file)
  580.     If pintNoIni Then
  581.       ' Save the default top and left
  582.       Call SaveIni("MsgBox", "Top", Trim(Str(Me.Top)), pstrMsgBoxIni)
  583.       Call SaveIni("MsgBox", "Left", Trim(Str(Me.Left)), pstrMsgBoxIni)
  584.       Call AboutCommand3D_Click   ' Show the about screen
  585.     End If
  586. End Sub
  587. Sub Form_Unload (Cancel As Integer)
  588.   Dim pstrMsgBoxIni As String
  589.   ' Get the app's ini file and location
  590.   pstrMsgBoxIni = MakePath((app.Path), app.EXEName & ".ini")
  591.   ' If the window is not minimized save the postion of it
  592.   If Me.WindowState <> 1 Then
  593.     Call SaveIni("MsgBox", "Top", Trim(Str(Me.Top)), pstrMsgBoxIni)
  594.     Call SaveIni("MsgBox", "Left", Trim(Str(Me.Left)), pstrMsgBoxIni)
  595.   End If
  596. End Sub
  597. Function Get3DCode (Indent As String) As String
  598.   Dim pstrMsgBoxIni As String
  599.   Dim pstr3DUse As String
  600.   Dim pstr3DSub As String
  601.   Dim pstrIncCode As String
  602.   Dim pstr3DSubName As String
  603.   ' I want to make this whole sub changeable through a data file or some other way???
  604.   ' Suggestions are welcome
  605.   pstrMsgBoxIni = MakePath((app.Path), app.EXEName & ".ini")
  606.   pstr3DUse = ReadIni("Code Options", "Use 3D", "Never", pstrMsgBoxIni)
  607.   pstrIncCode = ReadIni("Code Options", "Inc 3D Code", "0", pstrMsgBoxIni)
  608.   pstr3DSubName = ReadIni("Code Options", "3D Code Name", "Turn3dOnOff", pstrMsgBoxIni)  ' Can not set form UI need to change
  609.   If pstr3DUse <> "Never" And Val(pstrIncCode) Then
  610.     pstr3DSub = gstrCR & gstrCR & "' Procedure:  " & pstr3DSubName & gstrCR
  611.     pstr3DSub = pstr3DSub & "' Arguments:  None" & gstrCR
  612.     pstr3DSub = pstr3DSub & "'" & gstrCR
  613.     pstr3DSub = pstr3DSub & "' Note: This sub will turn the 3d of the CTL3D.DLL or CTL3DV2.DLL on and off." & gstrCR
  614.     pstr3DSub = pstr3DSub & "'       This can be used throughout an app (saffer) or just once to trun it" & gstrCR
  615.     pstr3DSub = pstr3DSub & "'       on then once to turn it off." & gstrCR
  616.     pstr3DSub = pstr3DSub & "'" & gstrCR
  617.     pstr3DSub = pstr3DSub & "Sub " & pstr3DSubName & "()" & gstrCR & gstrCR
  618.     pstr3DSub = pstr3DSub & Indent & "Static pintInst as integer ' Holds the inst handle of the app" & gstrCR
  619.     pstr3DSub = pstr3DSub & Indent & "Static pint3dOn as integer ' Holds flag of if 3d is on (true) or off (false)" & gstrCR
  620.     pstr3DSub = pstr3DSub & Indent & "Dim pintTemp as integer    ' Temp not to be used" & gstrCR & gstrCR
  621.     pstr3DSub = pstr3DSub & Indent & "If pintInst = 0 Then       ' If no inst handle retreved yet" & gstrCR
  622.     pstr3DSub = pstr3DSub & Indent & Indent & "' Get an inst handle for this app" & gstrCR
  623.     pstr3DSub = pstr3DSub & Indent & Indent & "pintInst = GetModuleHandle((app.EXEName))" & gstrCR
  624.     pstr3DSub = pstr3DSub & Indent & "End If" & gstrCR & gstrCR
  625.     pstr3DSub = pstr3DSub & Indent & "If pint3dOn Then           ' If pint3dOn flag is true (3d is on)" & gstrCR
  626.     pstr3DSub = pstr3DSub & Indent & Indent & "' Unregister 3d (turn 3d off)" & gstrCR
  627.     pstr3DSub = pstr3DSub & Indent & Indent & "pintTemp = Ctl3dUnregister(pintInst)" & gstrCR
  628.     pstr3DSub = pstr3DSub & Indent & Indent & "pint3dOn = False" & gstrCR
  629.     pstr3DSub = pstr3DSub & Indent & "Else" & gstrCR
  630.     pstr3DSub = pstr3DSub & Indent & Indent & "' Register 3d (turn 3d on)" & gstrCR
  631.     pstr3DSub = pstr3DSub & Indent & Indent & "pintTemp = Ctl3dRegister(pintInst)" & gstrCR
  632.     pstr3DSub = pstr3DSub & Indent & Indent & "pintTemp = Ctl3dAutoSubClass(pintInst)" & gstrCR
  633.     pstr3DSub = pstr3DSub & Indent & Indent & "pint3dOn = True" & gstrCR
  634.     pstr3DSub = pstr3DSub & Indent & "End if" & gstrCR & gstrCR
  635.     pstr3DSub = pstr3DSub & "End Sub"
  636.   End If
  637.   If pstr3DUse = "Startup" Then
  638.     pstr3DSub = "' code and your ending code ie Form_Load and Form_Unload" & gstrCR & gstrCR & gstrCR & pstr3DSub
  639.     pstr3DSub = "' You will need to add calles to the next sub in your starting" & gstrCR & pstr3DSub
  640.     pstr3DSub = gstrCR & gstrCR & pstr3DSub
  641.   End If
  642.   Get3DCode = pstr3DSub
  643. End Function
  644. Function Get3DDecl () As String
  645.   Dim pstrDeclares As String
  646.   Dim pstrMsgBoxIni As String
  647.   Dim pstrInc3DDecl As String
  648.   pstrDeclares = ""
  649.   pstrMsgBoxIni = MakePath((app.Path), app.EXEName & ".ini")
  650.   pstrInc3DDecl = ReadIni("Code Options", "Inc 3D Decl", "0", pstrMsgBoxIni)
  651.   If Val(pstrInc3DDecl) = True Then
  652.     pstrDeclares = "' Declare the fun needed to get the apps module handle" & gstrCR
  653.     pstrDeclares = pstrDeclares & "Declare Function GetModuleHandle Lib " & Chr(34) & "Kernel" & Chr(34) & "  (ByVal lpModuleName As String) As Integer" & gstrCR & gstrCR
  654.     pstrDeclares = pstrDeclares & "' Declares to make CTL3D.DLL work" & gstrCR
  655.     pstrDeclares = pstrDeclares & "Declare Function Ctl3dRegister Lib  " & Chr(34) & "CTL3D.DLL" & Chr(34) & "  (ByVal hInstance As Integer) As Integer" & gstrCR
  656.     pstrDeclares = pstrDeclares & "Declare Function Ctl3dAutoSubClass Lib  " & Chr(34) & "CTL3D.DLL" & Chr(34) & "  (ByVal hInstance As Integer) As Integer" & gstrCR
  657.     pstrDeclares = pstrDeclares & "Declare Function Ctl3dUnregister Lib  " & Chr(34) & "CTL3D.DLL" & Chr(34) & "  (ByVal hInstance As Integer) As Integer" & gstrCR & gstrCR
  658.     pstrDeclares = pstrDeclares & "' Declares to make CTL3DV2.DLL work" & gstrCR
  659.     pstrDeclares = pstrDeclares & "'Declare Function Ctl3dRegister Lib  " & Chr(34) & "CTL3DV2.DLL" & Chr(34) & "  (ByVal hInstance As Integer) As Integer" & gstrCR
  660.     pstrDeclares = pstrDeclares & "'Declare Function Ctl3dAutoSubClass Lib  " & Chr(34) & "CTL3DV2.DLL" & Chr(34) & "  (ByVal hInstance As Integer) As Integer" & gstrCR
  661.     pstrDeclares = pstrDeclares & "'Declare Function Ctl3dUnregister Lib  " & Chr(34) & "CTL3DV2.DLL" & Chr(34) & "  (ByVal hInstance As Integer) As Integer" & gstrCR & gstrCR
  662.   End If
  663.   Get3DDecl = pstrDeclares
  664. End Function
  665. Function GetConsts (Indent As String, ConstStyle As String) As String
  666.   Dim pstrMsgBoxIni As String
  667.   Dim pstrIncConst As String
  668.   Dim pstrConstType As String
  669.   Dim pstrConstDef As String
  670.   Dim pstrConstUse As String
  671.   pstrMsgBoxIni = MakePath((app.Path), app.EXEName & ".ini")
  672.   pstrIncConst = ReadIni("Code Options", "Include Const", pstrIncConst, pstrMsgBoxIni)
  673.   pstrConstType = ReadIni("Code Options", "Const Type", pstrConstType, pstrMsgBoxIni)
  674.   If pstrConstType = "Local" Then
  675.     ' Get the const for the type of button
  676.     Select Case gintButtonstyle
  677.       Case 0
  678.     pstrConstDef = Indent & "Const MB_OK = 0                 ' OK button only" & gstrCR
  679.     pstrConstUse = "MB_OK +"
  680.       Case 1
  681.     pstrConstDef = Indent & "Const MB_OKCANCEL = 1           ' OK and Cancel buttons" & gstrCR
  682.     pstrConstUse = "MB_OKCANCEL +"
  683.       Case 2
  684.     pstrConstDef = Indent & "Const MB_ABORTRETRYIGNORE = 2   ' Abort, Retry, and Ignore buttons" & gstrCR
  685.     pstrConstUse = "MB_ABORTRETRYIGNORE +"
  686.       Case 3
  687.     pstrConstDef = Indent & "Const MB_YESNOCANCEL = 3        ' Yes, No, and Cancel buttons" & gstrCR
  688.     pstrConstUse = "MB_YESNOCANCEL +"
  689.       Case 4
  690.     pstrConstDef = Indent & "Const MB_YESNO = 4              ' Yes and No buttons" & gstrCR
  691.     pstrConstUse = "MB_YESNO +"
  692.       Case 5
  693.     pstrConstDef = Indent & "Const MB_RETRYCANCEL = 5        ' Retry and Cancel buttons" & gstrCR
  694.     pstrConstUse = "MB_RETRYCANCEL +"
  695.     End Select
  696.     ' Get the const for the default button
  697.     Select Case gintDefault
  698.       Case 0
  699.     If gintButtonstyle <> 0 Then
  700.       pstrConstDef = pstrConstDef & Indent & "Const MB_DEFBUTTON1 = 0         ' First button is default" & gstrCR
  701.       pstrConstUse = pstrConstUse & " MB_DEFBUTTON1 +"
  702.     End If
  703.       Case 256
  704.     pstrConstDef = pstrConstDef & Indent & "Const MB_DEFBUTTON2 = 256       ' Second button is default" & gstrCR
  705.     pstrConstUse = pstrConstUse & " MB_DEFBUTTON2 +"
  706.       Case 512
  707.     pstrConstDef = pstrConstDef & Indent & "Const MB_DEFBUTTON3 = 512       ' Third button is default" & gstrCR
  708.     pstrConstUse = pstrConstUse & " MB_DEFBUTTON3 +"
  709.     End Select
  710.     ' Get the const for the type if icon
  711.     Select Case gintIconstyle
  712.       Case 16
  713.     pstrConstDef = pstrConstDef & Indent & "Const MB_ICONSTOP = 16          ' Critical message" & gstrCR
  714.     pstrConstUse = pstrConstUse & " MB_ICONSTOP +"
  715.       Case 32
  716.     pstrConstDef = pstrConstDef & Indent & "Const MB_ICONQUESTION = 32      ' Warning query" & gstrCR
  717.     pstrConstUse = pstrConstUse & " MB_ICONQUESTION +"
  718.       Case 48
  719.     pstrConstDef = pstrConstDef & Indent & "Const MB_ICONEXCLAMATION = 48   ' Warning message" & gstrCR
  720.     pstrConstUse = pstrConstUse & " MB_ICONEXCLAMATION +"
  721.       Case 64
  722.     pstrConstDef = pstrConstDef & Indent & "Const MB_ICONINFORMATION = 64   ' Information message" & gstrCR
  723.     pstrConstUse = pstrConstUse & " MB_ICONINFORMATION +"
  724.     End Select
  725.     ' Get the const for the modal style
  726.     Select Case gintModal
  727.       Case 0
  728.     pstrConstDef = pstrConstDef & Indent & "Const MB_APPLMODAL = 0          ' Application Modal Message Box" & gstrCR
  729.     pstrConstUse = pstrConstUse & " MB_APPLMODAL"
  730.       Case Else
  731.     pstrConstDef = pstrConstDef & Indent & "Const MB_SYSTEMMODAL = 4096      'System Modal" & gstrCR
  732.     pstrConstUse = pstrConstUse & " MB_SYSTEMMODAL"
  733.     End Select
  734.     pstrConstDef = pstrConstDef & gstrCR & gstrCR
  735.   Else    ' None
  736.     GetConsts = ""
  737.     pstrConstUse = Str(gintDefault + gintIconstyle + gintButtonstyle + gintModal)
  738.   End If
  739.   ConstStyle = pstrConstUse
  740.   If Trim(pstrIncConst) = "1" Then
  741.     GetConsts = pstrConstDef
  742.   Else
  743.     GetConsts = ""
  744.   End If
  745. End Function
  746. Function GetDims (Indent As String, IncludeReturn As Integer, TheAnswer As String, TheMessage As String, TheStyle As String, TheTitle As String, TheRLF As String) As String
  747.   Dim pstrWorking As String
  748.   If TheStyle <> "" Then
  749.     pstrWorking = Indent & "Dim " & TheStyle & " as integer" & gstrCR
  750.   End If
  751.   If CodeOpt3D(1).Value Then    ' If function call
  752.     pstrWorking = pstrWorking & Indent & "Dim " & TheAnswer & " as integer" & gstrCR
  753.   End If
  754.   If TheMessage <> "" Then
  755.     pstrWorking = pstrWorking & Indent & "Dim " & TheMessage & " as string" & gstrCR
  756.   End If
  757.   If Len(gstrTheTitle) And TheTitle <> "" Then      ' If there is a title add it's dim
  758.     pstrWorking = pstrWorking & Indent & "Dim " & TheTitle & " as string" & gstrCR
  759.   End If
  760.   If IncludeReturn Then
  761.     pstrWorking = pstrWorking & Indent & "Dim " & TheRLF & " as string" & gstrCR
  762.     pstrWorking = pstrWorking & "" & gstrCR
  763.     pstrWorking = pstrWorking & Indent & TheRLF & " = Chr$(13) & Chr$(10)" & gstrCR
  764.   Else
  765.     pstrWorking = pstrWorking & "" & gstrCR
  766.   End If
  767.   GetDims = pstrWorking
  768. End Function
  769. Function GetGloCon () As String
  770.   Dim pstrMsgBoxIni As String
  771.   Dim pstrIncConst As String
  772.   Dim pstrConstType As String
  773.   Dim pstrConstDef As String
  774.   pstrMsgBoxIni = MakePath((app.Path), app.EXEName & ".ini")
  775.   pstrIncConst = ReadIni("Code Options", "Include Const", pstrIncConst, pstrMsgBoxIni)
  776.   pstrConstType = ReadIni("Code Options", "Const Type", pstrConstType, pstrMsgBoxIni)
  777.   pstrConstDef = ""
  778.   If Trim(pstrIncConst) = "1" And pstrConstType = "Global" Then
  779.     pstrConstDef = "' MsgBox parameters" & gstrCR
  780.     pstrConstDef = pstrConstDef & "Global Const MB_OK = 0                 ' OK button only" & gstrCR
  781.     pstrConstDef = pstrConstDef & "Global Const MB_OKCANCEL = 1           ' OK and Cancel buttons" & gstrCR
  782.     pstrConstDef = pstrConstDef & "Global Const MB_ABORTRETRYIGNORE = 2   ' Abort, Retry, and Ignore buttons" & gstrCR
  783.     pstrConstDef = pstrConstDef & "Global Const MB_YESNOCANCEL = 3        ' Yes, No, and Cancel buttons" & gstrCR
  784.     pstrConstDef = pstrConstDef & "Global Const MB_YESNO = 4              ' Yes and No buttons" & gstrCR
  785.     pstrConstDef = pstrConstDef & "Global Const MB_RETRYCANCEL = 5        ' Retry and Cancel buttons" & gstrCR & gstrCR
  786.     pstrConstDef = pstrConstDef & "Global Const MB_ICONSTOP = 16          ' Critical message" & gstrCR
  787.     pstrConstDef = pstrConstDef & "Global Const MB_ICONQUESTION = 32      ' Warning query" & gstrCR
  788.     pstrConstDef = pstrConstDef & "Global Const MB_ICONEXCLAMATION = 48   ' Warning message" & gstrCR
  789.     pstrConstDef = pstrConstDef & "Global Const MB_ICONINFORMATION = 64   ' Information message" & gstrCR & gstrCR
  790.     pstrConstDef = pstrConstDef & "Global Const MB_DEFBUTTON1 = 0         ' First button is default" & gstrCR
  791.     pstrConstDef = pstrConstDef & "Global Const MB_DEFBUTTON2 = 256       ' Second button is default" & gstrCR
  792.     pstrConstDef = pstrConstDef & "Global Const MB_DEFBUTTON3 = 512       ' Third button is default" & gstrCR & gstrCR
  793.     pstrConstDef = pstrConstDef & "Global Const MB_APPLMODAL = 0          ' Application Modal Message Box" & gstrCR
  794.     pstrConstDef = pstrConstDef & "Global Const MB_SYSTEMMODAL = 4096      'System Modal" & gstrCR & gstrCR
  795.     pstrConstDef = pstrConstDef & "' MsgBox return values" & gstrCR
  796.     pstrConstDef = pstrConstDef & "Global Const IDOK = 1                  ' OK button pressed" & gstrCR
  797.     pstrConstDef = pstrConstDef & "Global Const IDCANCEL = 2              ' Cancel button pressed" & gstrCR
  798.     pstrConstDef = pstrConstDef & "Global Const IDABORT = 3               ' Abort button pressed" & gstrCR
  799.     pstrConstDef = pstrConstDef & "Global Const IDRETRY = 4               ' Retry button pressed" & gstrCR
  800.     pstrConstDef = pstrConstDef & "Global Const IDIGNORE = 5              ' Ignore button pressed" & gstrCR
  801.     pstrConstDef = pstrConstDef & "Global Const IDYES = 6                 ' Yes button pressed" & gstrCR
  802.     pstrConstDef = pstrConstDef & "Global Const IDNO = 7                  ' No button pressed" & gstrCR & gstrCR & gstrCR
  803.   End If
  804.   GetGloCon = pstrConstDef
  805. End Function
  806. Function GetIndent (MsgBoxIni As String) As String
  807.   GetIndent = String(Trim(ReadIni("Code Options", "Tab Stop", "2", MsgBoxIni)), " ")
  808. End Function
  809. Function GetMsgBoxCall (Indent As String, TheAnswer As String, TheMessage As String, TheStyle As String, TheTitle As String) As String
  810.   Dim pstrMsgBox As String
  811.   Dim pstrMsgBoxIni As String
  812.   Dim pstr3DUse As String
  813.   Dim pstr3DSubName As String
  814.   Dim pstrTheMessage As String
  815.   pstrMsgBoxIni = MakePath((app.Path), app.EXEName & ".ini")
  816.   pstr3DUse = ReadIni("Code Options", "Use 3D", "Never", pstrMsgBoxIni)
  817.   pstr3DSubName = ReadIni("Code Options", "3D Code Name", "Turn3dOnOff", pstrMsgBoxIni)   ' Can not set form UI need to change
  818.   ' this can cause some ugly errors  But.....
  819.   If TheMessage = "" Then
  820.     If InStr(gstrRawMessage, Chr(10)) Then
  821.       pstrTheMessage = "You have a line brake in your message and have no variable for the message.  This will most likely cause a problem with the code produced."
  822.       Call Turn3dOnOff
  823.       MsgBox pstrTheMessage, 64, "MsgBox"
  824.       Call Turn3dOnOff
  825.     End If
  826.     TheMessage = Chr(34) & gstrRawMessage & Chr(34)
  827.   End If
  828.   If CodeOpt3D(0).Value Then      ' If statement is selected
  829.     pstrMsgBox = Indent & "MsgBox " & TheMessage & ", " & TheStyle
  830.     If Len(gstrTheTitle) Then     ' If there is a title add it to the msgbox call
  831.       pstrMsgBox = pstrMsgBox & ", " & TheTitle
  832.     End If
  833.     pstrMsgBox = pstrMsgBox & gstrCR
  834.   Else                            ' If function is selected
  835.     pstrMsgBox = Indent & TheAnswer & " = MsgBox(" & TheMessage & ", " & TheStyle
  836.     If Len(gstrTheTitle) Then     ' If there is a title add it to the msgbox call
  837.       pstrMsgBox = pstrMsgBox & ", " & TheTitle
  838.     End If
  839.     pstrMsgBox = pstrMsgBox & ")" & gstrCR
  840.   End If
  841.   If pstr3DUse = "Always" Then
  842.     pstrMsgBox = Indent & "Call " & pstr3DSubName & gstrCR & pstrMsgBox
  843.     pstrMsgBox = pstrMsgBox & Indent & "Call " & pstr3DSubName & gstrCR
  844.   End If
  845.   GetMsgBoxCall = pstrMsgBox
  846. End Function
  847. Function GetMsgBoxCode () As String
  848.   Dim pintTheAnswer As Integer
  849.   Dim pintIncludeRet As Integer
  850.   Dim pstrTheStyle As String
  851.   Dim pstrCR As String
  852.   Dim pstrHeader As String
  853.   Dim pstrHandler As String
  854.   Dim pstrTheAnswerName As String
  855.   Dim pstrTheMessageName As String
  856.   Dim pstrTheStyleName As String
  857.   Dim pstrTheTitleName As String
  858.   Dim pstrTheRLF As String
  859.   Dim pstrMsgBoxIni As String
  860.   Dim pstrIndent As String
  861.   pstrCR = gstrCR & gstrCR
  862.   ' Get the app's ini file name and location
  863.   pstrMsgBoxIni = MakePath((app.Path), app.EXEName & ".ini")
  864.   ' Get all Variable names from the ini file
  865.   Call GetVariablesNames(pstrMsgBoxIni, pstrTheAnswerName, pstrTheMessageName, pstrTheStyleName, pstrTheTitleName, pstrTheRLF)
  866.   ' Get a string of blanks the size of the Tab Stop option
  867.   pstrIndent = GetIndent(pstrMsgBoxIni)
  868.   ' Get the message ready for display
  869.   gstrTheMessage = SetMessageUp(pstrIndent, pstrTheMessageName, pstrTheRLF)
  870.   ' Find if we need to include the return line feed in the code
  871.   pintIncludeRet = InStr(gstrTheMessage, pstrTheRLF)
  872.   ' Get global constants if needed
  873.   pstrHeader = GetGloCon()
  874.   ' Get Declares for 3D if needed
  875.   pstrHeader = pstrHeader & Get3DDecl()
  876.   ' Get the required constants
  877.   ' and Bild the style from default button the icon style and what buttins to use
  878.   pstrHeader = pstrHeader & GetConsts(pstrIndent, pstrTheStyle)
  879.   ' Get the required dimension statements and put in final code
  880.   pstrHeader = pstrHeader & GetDims(pstrIndent, pintIncludeRet, pstrTheAnswerName, pstrTheMessageName, pstrTheStyleName, pstrTheTitleName, pstrTheRLF)
  881.   ' Add the message definition to the final code
  882.   If pstrTheMessageName <> "" Then
  883.     pstrHeader = pstrHeader & gstrTheMessage
  884.   End If
  885.   ' Add the style definition to the final code
  886.   If pstrTheStyleName <> "" Then
  887.     pstrHeader = pstrHeader & pstrIndent & pstrTheStyleName & " = " & pstrTheStyle & gstrCR
  888.   Else
  889.     pstrTheStyleName = pstrTheStyle
  890.   End If
  891.   ' If there is a titel
  892.   If Len(gstrTheTitle) Then
  893.     If pstrTheTitleName <> "" Then
  894.       ' Add the title definition to the final code
  895.       pstrHeader = pstrHeader & pstrIndent & pstrTheTitleName & " = " & gstrQ & gstrTheTitle & gstrQ & gstrCR
  896.     Else
  897.       pstrTheTitleName = gstrQ & gstrTheTitle & gstrQ
  898.     End If
  899.   End If
  900.   ' Get and add the msgbox call to the final code according to what type of call is to be made
  901.   pstrHeader = pstrHeader & GetMsgBoxCall(pstrIndent, pstrTheAnswerName, pstrTheMessageName, pstrTheStyleName, pstrTheTitleName)
  902.   If CodeOpt3D(1).Value Then     ' If function is selected
  903.     ' Build function handler
  904.     Select Case gintButtonstyle
  905.       Case 5
  906.     pstrHandler = pstrIndent & "If " & pstrTheAnswerName & " = 4 Then  'Answered Retry" & pstrCR
  907.     pstrHandler = pstrHandler & pstrIndent & "Else     'Answered Cancel" & pstrCR & pstrIndent & "End If" & gstrCR
  908.       Case 4
  909.     pstrHandler = pstrIndent & "If " & pstrTheAnswerName & " = 6 Then  'Answered Yes" & pstrCR
  910.     pstrHandler = pstrHandler & pstrIndent & "Else     'Answered No" & pstrCR & pstrIndent & "End If" & gstrCR
  911.       Case 3
  912.     pstrHandler = pstrIndent & "Select Case " & pstrTheAnswerName & gstrCR & pstrIndent & pstrIndent & "Case 7     'Pressed No" & pstrCR
  913.     pstrHandler = pstrHandler & pstrIndent & pstrIndent & "Case 6     'Answered Yes" & pstrCR
  914.     pstrHandler = pstrHandler & pstrIndent & pstrIndent & "Case Else  'Answered Cancel" & pstrCR & pstrIndent & "End Select" & gstrCR
  915.       Case 2
  916.     pstrHandler = pstrIndent & "Select Case " & pstrTheAnswerName & gstrCR & pstrIndent & pstrIndent & "Case 5     'Pressed Ignore" & pstrCR
  917.     pstrHandler = pstrHandler & pstrIndent & pstrIndent & "Case 4     'Answered Retry" & pstrCR
  918.     pstrHandler = pstrHandler & pstrIndent & pstrIndent & "Case Else  'Answered Abort" & pstrCR & pstrIndent & "End Select" & gstrCR
  919.       Case 1
  920.     pstrHandler = pstrIndent & "If " & pstrTheAnswerName & " = 1 Then  'Answered OK" & pstrCR
  921.     pstrHandler = pstrHandler & pstrIndent & "Else     'Answered Cancel" & pstrCR & pstrIndent & "End If" & gstrCR
  922.       Case Else
  923.     pstrHandler = ""
  924.     End Select
  925.     ' Put handler on te final code
  926.     pstrHeader = pstrHeader & pstrHandler
  927.   End If
  928.   ' Get 3D sub if nessary
  929.   pstrHeader = pstrHeader & Get3DCode(pstrIndent)
  930.   GetMsgBoxCode = pstrHeader
  931. End Function
  932. Sub GetVariablesNames (MsgBoxIni As String, TheAnswer As String, TheMessage As String, TheStyle As String, TheTitle As String, TheRLF As String)
  933.   TheTitle = ReadIni("Code Options", "Title Name", "pstrTheTitle", MsgBoxIni)
  934.   TheMessage = ReadIni("Code Options", "Msg Name", "pstrTheMessage", MsgBoxIni)
  935.   TheStyle = ReadIni("Code Options", "Style Name", "pintTheStyle", MsgBoxIni)
  936.   TheAnswer = ReadIni("Code Options", "Answer Name", "pintTheAnswer", MsgBoxIni)
  937.   TheRLF = ReadIni("Code Options", "Return Name", "pstrRLF", MsgBoxIni)
  938.   If TheAnswer = "" Then TheAnswer = "pintTheAnswer"
  939.   If TheRLF = "" Then TheRLF = "pstrRLF"
  940. End Sub
  941. Sub IconPic_Click (Index As Integer)
  942.     Call SetIconPic(Index)
  943. End Sub
  944. Sub IconPic_GotFocus (Index As Integer)
  945.     Call SetIconPic(Index)
  946. End Sub
  947. Sub IcPicLabel_Click (Index As Integer)
  948.     IconPic(Index).SetFocus
  949. End Sub
  950. Sub optDefButton_Click (Index As Integer, Value As Integer)
  951.   ' Set Global to the Default button setting
  952.   gintDefault = Index
  953. End Sub
  954. Sub optModal_Click (Index As Integer, Value As Integer)
  955.   ' Set Global to the modal setting
  956.   gintModal = Index
  957. End Sub
  958. Sub SetIconPic (Index As Integer)
  959.     Dim pintCount As Integer
  960.     gintIconstyle = Index
  961.     IconPic(gintIconstyle).BorderStyle = 1
  962.     For pintCount = 0 To 64 Step 16
  963.     If IconPic(pintCount).Index <> gintIconstyle Then
  964.         IconPic(pintCount).BorderStyle = 0
  965.     End If
  966.     Next pintCount
  967. End Sub
  968. Function SetMessageUp (Indent As String, TheMessageName As String, TheRLF As String) As String
  969.   Dim pintAReturn As Integer
  970.   Dim pintPass As Integer
  971.   Dim pstrCReturn As String
  972.   Dim pstrTempMessage As String
  973.   pstrCReturn = gstrQ & " & " & TheRLF
  974.   pstrTempMessage = gstrRawMessage
  975.   ' If message is more then one line long
  976.   pintAReturn = InStr(pstrTempMessage, Chr$(13))
  977.   If pintAReturn > 0 Then
  978.     pintPass = 0
  979.     While pintAReturn <> 0
  980.       If Len(pstrTempMessage) > 2 Then
  981.     If pintPass = 0 Then
  982.       gstrTheMessage = Indent & TheMessageName & " = " & gstrQ & Left$(pstrTempMessage, pintAReturn - 1) & pstrCReturn & gstrCR
  983.     Else
  984.       gstrTheMessage = gstrTheMessage & Indent & TheMessageName & " = " & TheMessageName & " & " & gstrQ & Left$(pstrTempMessage, pintAReturn - 1) & pstrCReturn & gstrCR
  985.     End If
  986.       pintPass = pintPass + 1
  987.       pstrTempMessage = Mid$(pstrTempMessage, pintAReturn + 2)
  988.       End If
  989.     pintAReturn = InStr(pstrTempMessage, Chr$(13))
  990.     Wend
  991.     SetMessageUp = gstrTheMessage & Indent & TheMessageName & " = " & TheMessageName & " & " & gstrQ & pstrTempMessage & pstrCReturn & gstrCR
  992.   ElseIf Len(pstrTempMessage) > 150 Then
  993.     pintPass = 0
  994.     While Len(pstrTempMessage) > 150
  995.       If pintPass = 0 Then
  996.     gstrTheMessage = Indent & TheMessageName & " =  & " & gstrQ & Left$(pstrTempMessage, 150) & gstrQ & gstrCR
  997.       Else
  998.     gstrTheMessage = gstrTheMessage & Indent & TheMessageName & " = " & TheMessageName & " & " & gstrQ & Left$(pstrTempMessage, 150) & gstrQ & gstrCR
  999.       End If
  1000.       pintPass = pintPass + 1
  1001.       pstrTempMessage = Mid$(pstrTempMessage, 151)
  1002.     Wend
  1003.     SetMessageUp = gstrTheMessage & Indent & TheMessageName & " = " & TheMessageName & " & " & gstrQ & pstrTempMessage & gstrQ & gstrCR
  1004.   Else
  1005.     SetMessageUp = Indent & TheMessageName & " = " & gstrQ & pstrTempMessage & gstrQ & gstrCR
  1006.   End If
  1007. End Function
  1008.